@PACKAGE_INIT@

# Temporarily extend module path for bundled find package scripts
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

include(CMakeFindDependencyMacro)
include(MacroFindDependencyComponents)

find_dependency_components(Boost VERSION @Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@ COMPONENTS @Boost_COMPONENTS@)
find_dependency(GeographicLib @GeographicLib_VERSION_STRING@)
find_dependency(Threads)

if(@CryptoPP_FOUND@)
    find_dependency(CryptoPP @CryptoPP_VERSION_STRING@)
endif()

if(@OPENSSL_FOUND@)
    string(REGEX REPLACE "[a-z]+" "" OPENSSL_VERSION_WITHOUT_PATCH @OPENSSL_VERSION@)
    # workaround for old CMake versions before 3.3
    if("${CMAKE_VERSION}" VERSION_LESS 3.3)
        function(fix_openssl_found variable access value)
            set(OpenSSL_FOUND ${value} PARENT_SCOPE)
        endfunction()
        variable_watch(OPENSSL_FOUND fix_openssl_found)
    endif()
    find_dependency(OpenSSL ${OPENSSL_VERSION_WITHOUT_PATCH})
endif()

if(@THREADS_FOUND@)
    find_dependency(Threads)
endif()

# Restore previous module path
list(REMOVE_AT CMAKE_MODULE_PATH -1)

include("${CMAKE_CURRENT_LIST_DIR}/CompatBoostTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/CompatOpenSSLTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/VanetzaTargets.cmake")

set_and_check(VANETZA_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
